package io;

import java.io.*;

/*
  字符流读取
 */
public class ISRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fin = new FileInputStream("osw.txt");
        InputStreamReader in = new InputStreamReader(fin,"UTF-8");
        /*
          读取一个字符  返回的int实际上是一个char类型  但如果返回的int对应的整数为-1则表示流读取到了末尾
         */
         int d;
         while ((d = in.read())!=-1){
             System.out.print((char)d);
         }
   in.close();



    }




}
